// JavaScript代码

window.addEventListener('DOMContentLoaded', function() {
    fetch('Navigation_bar.html')
        .then(response => response.text())
        .then(data => {
            const navContainer = document.querySelector('.nav-container');
            navContainer.innerHTML = data;
        })
        .catch(error => console.log('导航栏内容无法加载：', error));

    const dragBox = document.querySelector('.drag-box');
    const dropBox = document.querySelector('.drop-box');
    let isDragging = false; // 标记是否正在拖动

    dragBox.addEventListener('mousedown', (event) => {
        event.preventDefault();
        isDragging = true;
        dragBox.style.opacity = '0.5';
    });
});
document.body.addEventListener('mousedown', function(){
    var myAuto = document.getElementById('bgMusic');
    myAuto.play();
}, false);